<template>

	<view class="coreJoin_box">
		<view class="coreJoin_img">
			<image src="/static/img/coreJoin_1.png" mode="widthFix"></image>
		</view>
		<view class="coreJoin_title">招募合伙人</view>
		<view class="coreJoin_block">
			<view class="coreJoin_name">个人信息</view>
			<view class="coreJoin_input">
				<input type="text" placeholder="请输入您的姓名" v-model="form.name"></input>
			</view>
			<view class="coreJoin_input">
				<input type="text" placeholder="请输入您的手机号" v-model="form.mobile"></input>
			</view>
			<view class="coreJoin_btn" @click="toDistribution">提交信息</view>
		</view>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				form: {
					token: uni.getStorageSync('userToken'),
					name: '',
					mobile: ''
				}
			}
		},
		methods: {
			toDistribution() {
				for (let i in this.form) {
					if (!this.form[i]) {
						return this.$Toast('请填写完信息后再提交');
					}
				}

				if (!this.$reg.mobile.test(this.form.mobile)) {
					return this.$Toast('请填写正确的手机号')
				}
				console.log(this.form)
				this.$post(this.$api.applyDis, this.form, (res) => {
					let {
						data
					} = res;
					if (data.code == 1) {
						this.$Toast('申请成功,请耐心等候');
						setTimeout(() => {
							uni.switchTab({
								url: '/pages/tabar/index'
							})
						}, 1000)

					}
				})
			}
		}
	}
</script>

<style scoped>
	page {}

	.coreJoin_box {
		position: relative;
		background: linear-gradient(180deg, #FFE048 0%, #FF9000 100%);
		min-height: 100vh;
		width: 100%;
	}

	.coreJoin_img {
		text-align: center;
	}

	.coreJoin_img image {
		width: 465rpx;
	}

	.coreJoin_title {
		width: 100%;
		font-size: 110rpx;
		text-align: center;
		font-weight: bold;
		color: #FFFFFF;
		text-shadow: 0px 6px 6px rgba(130, 32, 0, 0.3);
		position: absolute;
		top: 260rpx;
		left: 0;
	}

	.coreJoin_block {
		width: 690rpx;
		height: 520rpx;
		background: #FFFFFF;
		border-radius: 10rpx;
		margin: 0 auto;
	}

	.coreJoin_name {
		text-align: center;
		font-size: 36rpx;
		color: #333333;
		padding: 40rpx 0 60rpx;
	}

	.coreJoin_input {
		width: 630rpx;
		height: 70rpx;
		background: #EEEEEE;
		border-radius: 10rpx;
		font-size: 30rpx;
		color: #999999;
		margin: 0 auto 30rpx;
	}

	.coreJoin_input input {
		width: 100%;
		height: 79rpx;
		padding: 0 18rpx;
	}

	.coreJoin_btn {
		width: 584rpx;
		height: 90rpx;
		text-align: center;
		line-height: 90rpx;
		background: #FFCC33;
		border-radius: 45rpx;
		font-size: 36rpx;
		color: #333333;
		margin: 60rpx auto 0;
	}
</style>
